
#include "./meshdef/cgaltypes.h"
#include "typedefs.h"
#include "enumtypes.h"
#include "./core/constraints.h"
#include "./meshdef/skeleton.h"
#include "./meshdef/meshWithSkeleton.h"

//using namespace MLS;

/// This file defines functions of drawing using the OpenGL API

/// Generates a table with several rgb colors
void generateColors();

/// Renders a mesh model using vertex buffers (very efficient!)
void glDrawModel(Mesh *model, int meshrendermode_mask);

/// Renders rigging/skining data
void glDrawRiggingSkinning(Mesh *model, int mode_mask, bool usingbones);

/// Renders a mesh model using tipical opengl calls (inefficient)
void glDrawModel(Mesh *shape);

/// Render the mesh visualizing the rigging results
void glDrawRigging(Mesh *model);

void glDrawRiggingEdges(MeshWithSkeleton *model, bool usingbones);

/// Render the mesh visualizing the skinning results
void glDrawSkinning(Mesh *model);

/// Renders the current positions of the deformable model for selection purposes
void GLdrawVerticesForSelection(Mesh *model);

/// Renders the facets of the deformable model for selection purposes
void GLdrawFacesForSelection(Mesh *model);

//~ /// Renders the current positions of the deformable model(with skeleton) for selection purposes
//~ void GLdrawVerticesForSelection(MeshWithSkeleton *shape);

/// Renders the current positions of the skeleton's joints for selection purposes
void GLdrawVerticesForSelection(const Skeleton *skeleton);

/// Renders the bones of the skeleton for selection purposes
void GLdrawBonesForSelection(const Skeleton *skeleton);

/// Draws the positions of constraints 
void glDrawPositions(const Constraints &c);

/// Renders the constraints for using in selection mode
void glDrawForSelection(const Constraints &c);

/// Draws the positions of centroids
void glDrawCentroids(const vector<Vector3> &c);

/// Render the constraints in a trihedrn format for using in selection mode 
void glDrawForSelectionTrihedron(const Constraints &c);

/// Draws the skeleton defined by its initial(reference) geometry
void glDrawSkel(const Skeleton *s);

/// Draws the skeleton defined by its current geometry
//~ void glDrawDef(const Skeleton *s);

/// Draws a join and its vertices
/// @param model the mesh
/// @param idjoin the join's id
void drawOneJointANDitsVertices(MeshWithSkeleton *model, unsigned int idjoint);

void drawOneMeshVertexANDitsJoints(MeshWithSkeleton *model, unsigned int idvertex);

void drawOneMeshVertexANDitsJoint(MeshWithSkeleton *model, unsigned int idvertex);

/// Draws a joint and their associated vertices after the rigging process
void drawOneJointANDitsVertice(MeshWithSkeleton *model, unsigned int idjoint);

/// Draws a 3D cursor
void drawCursor3D(const Point3 &c, float sf);

/// Draws the rings
void glDrawRings(list<list<Halfedge_handle> > &rings, Mesh *model);

/// Draws the poses list
void glDrawPosesPaths(std::vector<std::vector<Vector> > &poses, Constraints &constraints);
